<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'immagine-form',
        'enableAjaxValidation' => false,
            ));
    ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

        <?php echo $form->errorSummary($model); ?>

    <div class="row">
        <?php echo $form->labelEx($model, 'idGalleria'); ?>
        <?php
        $galleria = $model->galleria;
        if(!isset($model->galleria))
            $galleria = Galleria::model()->findByPk($_GET['idGalleria']);
        echo CHtml::encode($galleria->title); ?>

    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'title'); ?>
<?php echo $form->textField($model, 'title', array('size' => 60, 'maxlength' => 1500)); ?>
<?php echo $form->error($model, 'title'); ?>
    </div>

    <div class="row">
        <?php echo $form->labelEx($model, 'description'); ?>
<?php echo $form->textField($model, 'description', array('size' => 60, 'maxlength' => 1500)); ?>
<?php echo $form->error($model, 'description'); ?>
    </div>    

    <div class="row">
        <?php echo $form->labelEx($model, 'alt'); ?>
    <?php echo $form->textField($model, 'alt', array('size' => 60, 'maxlength' => 1500)); ?>
    <?php echo $form->error($model, 'alt'); ?>
    </div>
    <div class="row">

    <?php
    if (isset($model->files)) {
        echo CHtml::image($model->files->Thumbnails);
    }
    else
    {
        echo CHtml::activeFileField($model, 'imageFile');     
    }
    ?>
    </div>
    <div class="row buttons">
<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
    </div>

<?php $this->endWidget(); ?>

</div><!-- form -->